import {createI18n} from "vue-i18n";
import {useTodosStoreHook} from '../../src/store/todos.js'
// 本地语言包
import enLocale from "./package/en";
import zhCnLocale from "./package/zh-cn";

const todosStore = useTodosStoreHook();

const messages = {
    "zh-cn": {
        ...zhCnLocale,
    },
    en: {
        ...enLocale,
    },
};
const i18n = createI18n({
    legacy: false,
    locale: todosStore.locale,
    messages: messages,
    globalInjection: true,
});

// 全局注册 i18n
export default i18n;
